package cn.tedu.hospitalgroupproject.server.content.pojo.param;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 新增医生的参数类
 *
 * @author java@tedu.cn
 * @version 1.0
 */
@Data
public class DoctorAddNewParam implements Serializable {
    /*医生ID*/
    private Long id;
    /*
     * 姓名*/
    @NotNull(message = "请提交医生姓名")
    @Pattern(regexp = "^[a-zA-Z\\u4e00-\\u9fa5]{2,10}$",
            message = "姓名必须是2~4长度的字符组成，且不允许使用标点符号")
    @ApiModelProperty(value = "医生姓名", required = true)
    private String name;

    private String password;
    private String imgUrl;
    /*
    * 是否是管理员*/
    @NotNull(message = "请设置医生是否为管理员")
    @Range(max = 1, message = "是否为管理员的值必须是0或1")
    @ApiModelProperty(value = "是否为管理员，1=管理员，0=不是管理员", required = true, example = "0")
    private int isAdmin;
    private String gender;
    private  String age;

    @NotNull(message = "请设置医生电话")
    @Pattern(regexp = "^[0-9\\u4e00-\\u9fa5]{11}$",
            message = "电话必须是11长度的数字组成，且不允许使用标点符号")
    @ApiModelProperty(value = "电话",  example = "17371139962")
    private String phoneNumber;
    /*医生邮箱*/
    @NotNull(message = "请设置医生邮箱")
    @Pattern(regexp = "^[a-z0-9A-Z]+@[a-zA-Z0-9]+(\\.[a-zA-Z0-9]+)+$",
            message = "邮箱需包含@")
    @ApiModelProperty(value = "邮箱", required = true, example = "2933572193@qq.com")
    private String mailBox;
    /*
     * 医生职称ID*/
    @NotNull(message = "请设置医生职称ID")
    @Range(min = 1, message = "请提交正确的职称类别")
    @ApiModelProperty(value = "职称类别", required = true, example = "1")

    private Long doctorTitleId;
    /*
     * 诊所ID*/
    @NotNull(message = "请设置医生所在诊所ID")
    @Range(min = 1, message = "请提交正确的所在诊所类别")
    @ApiModelProperty(value = "所在诊所类别", required = true, example = "1")
    private Long clinicId;
}
